package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 门店商品库存访问数据库
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2024-04-15 17:15:24
 * @QQ号码 444141300
 * @Email service@fwtai.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class StoreGoodsDao{

  private final DaoHandle dao;

  public StoreGoodsDao(final DaoHandle dao){
    this.dao = dao;
  }

  public int edit(final PageFormData formData){
    return dao.execute("store_goods.edit",formData);
  }

  public Long queryExistById(final long kid){
    return dao.queryForLong("store_goods.queryExistById",kid);
  }

  public HashMap<String,Object> queryById(final long kid){
    return dao.queryForHashMap("store_goods.queryById",kid);
  }

  public List<HashMap<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListHashMap("store_goods.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("store_goods.listTotal",formData);
  }

  public Long getStoreId(final String userName){
    return dao.queryForLong("store_goods.getStoreId",userName);
  }

  public List<Long> getListGoods(){
    return dao.queryListEntity("store_goods.getListGoods");
  }

  public int addStoreGoods(final ArrayList<HashMap<String,Object>> list){
    return dao.execute("store_goods.addStoreGoods",list);
  }
}